package Calculator.Parser.Elements;

import Calculator.Exceptions.WrongExpressionException;
import Calculator.Parser.InfixParser;
import Calculator.Parser.Utilities;

public class Number extends Token{

	public Number(String id) {
		this.setId(id);
	}

	@Override
	public void performIteration(InfixParser infixParser) {
		infixParser.getOutput().add(this);
	}

	@Override
	public void checkCorrectSyntax(Token t) throws WrongExpressionException{
		if (!Utilities.RIGHT_PARENTHESIS.equals(t.getId()) && !t.isOperator()){
			throw new WrongExpressionException(this, t);
		}
	}

	@Override
	public Boolean isOperator() {
		return Boolean.FALSE;
	}

	@Override
	public Boolean isNumber() {
		return Boolean.TRUE;
	}

}
